package org.skyeye.modeling.rpc.request;

import java.util.HashMap;
import java.util.Map;

import com.google.gson.Gson;

public class Request {

	private String name;

	private Map<String, String> args = new HashMap();

	public Request(){
		
	}
	public String getName() {
		return name;
	}

	public Map<String, String> getArgs() {
		return args;
	}

	public void setName(String className) {
		this.name = className;
	}

	public void setArgs(Map<String, String> arg) {
		this.args.putAll(arg);
	}

	@Override
	public String toString() {
		String message = null;
		if (this.args.isEmpty()) {
			message= "{\"request\":{\"name\":\"" + name + "\"}}";
		} else {
			message = "{\"request\":"+new Gson().toJson(this)+"}";
		}
		return message;
	}
}
